If(Joy(1)=1 or Joy(1)=17) and MAP(Int(_PLAYER_X/16),Int((_PLAYER_Y-1)/16))<WALL_START and MAP(Int(_PLAYER_X+15)/16,Int((_PLAYER_Y-1)/16))<WALL_START
_PLAYER_DIRECTION=0
End If
' *****
' right
' *****
If(Joy(1)=8 or Joy(1)=24) and MAP(Int(_PLAYER_X+16)/16,Int(_PLAYER_Y/16))<WALL_START and MAP(Int(_PLAYER_X+16)/16,Int((_PLAYER_Y+15)/16))<WALL_START
_PLAYER_DIRECTION=2
End If
' ****
' down
' ****
If(Joy(1)=2 or Joy(1)=18) and MAP(Int(_PLAYER_X/16),Int((_PLAYER_Y+16)/16))<WALL_START and MAP(Int(_PLAYER_X+15)/16,Int((_PLAYER_Y+16)/16))<WALL_START
_PLAYER_DIRECTION=4
End If
' ****
' left
' ****
If(Joy(1)=4 or Joy(1)=20) and MAP(Int(_PLAYER_X-1)/16,Int((_PLAYER_Y)/16))<WALL_START and MAP(Int(_PLAYER_X-1)/16,Int((_PLAYER_Y+15)/16))<WALL_START
_PLAYER_DIRECTION=6
End If
' *****************************************
' checks diagonal movement if option chosen
' *****************************************
If DIAGONAL=1
' ********
' up-right
' ********
If(Joy(1)=9 or Joy(1)=25)
_PLAYER_DIRECTION=1
End If
' *********
' down-right
' *********
If(Joy(1)=10 or Joy(1)=26)
_PLAYER_DIRECTION=3
End If
' *********
' down-left
' *********
If(Joy(1)=6 or Joy(1)=22)
_PLAYER_DIRECTION=5
End If
' *******
' up-left
' *******
If(Joy(1)=5 or Joy(1)=21)
_PLAYER_DIRECTION=7
End If
' **********************************
' if joystick not moved we try and
' change direction to a non-diagonal
' **********************************
If(Joy(1)=0 or Joy(1)=16)
' **
' up
' **
If(_PLAYER_DIRECTION=1 or _PLAYER_DIRECTION=7) and MAP(Int(_PLAYER_X)/16,Int((_PLAYER_Y-1)/16))<WALL_START and MAP(Int(_PLAYER_X+15)/16,Int((_PLAYER_Y-1)/16))<WALL_START
_PLAYER_DIRECTION=0
End If
' ****
' down
' ****
If(_PLAYER_DIRECTION=3 or _PLAYER_DIRECTION=5) and MAP(Int(_PLAYER_X)/16,Int((_PLAYER_Y+16)/16))<WALL_START and MAP(Int(_PLAYER_X+15)/16,Int((_PLAYER_Y+16)/16))<WALL_START
_PLAYER_DIRECTION=4
End If
' *****
' right
' *****
If(_PLAYER_DIRECTION=1 or _PLAYER_DIRECTION=3) and MAP(Int(_PLAYER_X+16)/16,Int(_PLAYER_Y/16))<WALL_START and MAP(Int(_PLAYER_X+16)/16,Int((_PLAYER_Y+15)/16))<WALL_START
_PLAYER_DIRECTION=2
End If
' ****
' left
' ****
If(_PLAYER_DIRECTION=5 or _PLAYER_DIRECTION=7) and MAP(Int(_PLAYER_X-1)/16,Int((_PLAYER_Y)/16))<WALL_START and MAP(Int(_PLAYER_X-1)/16,Int((_PLAYER_Y+15)/16))<WALL_START
_PLAYER_DIRECTION=6
End If
End If
End If
' *******************************************
' test for arrow squares before moving player
' if player has crossed an arrow square
' direction is changed to opposite of arrow
' *******************************************
' ********
' up-arrow
' ********
If MAP(Int((_PLAYER_X+7)/16),Int((_PLAYER_Y+7)/16))=13
_PLAYER_DIRECTION=0
End If
' ***********
' right-arrow
' ***********
If MAP(Int((_PLAYER_X+7)/16),Int((_PLAYER_Y+7)/16))=14
_PLAYER_DIRECTION=2
End If
' **********
' down-arrow
' **********
If MAP(Int((_PLAYER_X+7)/16),Int((_PLAYER_Y+7)/16))=15
_PLAYER_DIRECTION=4
End If
' **********
' left-arrow
' **********
If MAP(Int((_PLAYER_X+7)/16),Int((_PLAYER_Y+7)/16))=16
_PLAYER_DIRECTION=6
End If
' ***********
' move player
' ***********
' **
' up
' **
If _PLAYER_DIRECTION=0 or _PLAYER_DIRECTION=1 or _PLAYER_DIRECTION=7
' **************
' animate player
' **************
' ***********
' normal mode
' ***********
If _PLAYER_STATE=0 and _PLAYER_DIRECTION=0 and _PLAYER_FRAME_DELAY=0
Add _PLAYER_FRAME,1,13 To 16
End If
' ***********
' absorb mode
' ***********
If _PLAYER_STATE=1 and _PLAYER_DIRECTION=0 and _PLAYER_FRAME_DELAY=0
Add _PLAYER_FRAME,1,34 To 37
End If
' ***********
' move player
' ***********
Add _PLAYER_Y,-_PLAYER_SPEED
' *************
' test for wall
' *************
If MAP(Int(_PLAYER_X/16),Int(_PLAYER_Y/16))>=WALL_START or MAP(Int(_PLAYER_X+15)/16,Int(_PLAYER_Y/16))>=WALL_START
Add _PLAYER_Y,_PLAYER_SPEED
End If
End If
' ****
' down
' ****
If _PLAYER_DIRECTION=4 or _PLAYER_DIRECTION=3 or _PLAYER_DIRECTION=5
' **************
' animate player
' **************
' ***********
' normal mode
' ***********
If _PLAYER_STATE=0 and _PLAYER_DIRECTION=4 and _PLAYER_FRAME_DELAY=0
Add _PLAYER_FRAME,1,9 To 12
End If
' ***********
' absorb mode
' ***********
If _PLAYER_STATE=1 and _PLAYER_DIRECTION=4 and _PLAYER_FRAME_DELAY=0
Add _PLAYER_FRAME,1,30 To 33
End If
' ***********
' move player
' ***********
Add _PLAYER_Y,_PLAYER_SPEED
' *************
' test for wall
' *************
If MAP(Int(_PLAYER_X/16),Int((_PLAYER_Y+15)/16))>=WALL_START or MAP(Int(_PLAYER_X+15)/16,Int((_PLAYER_Y+15)/16))>=WALL_START
Add _PLAYER_Y,-_PLAYER_SPEED
End If
End If
' *****
' right
' *****
If _PLAYER_DIRECTION=2 or _PLAYER_DIRECTION=1 or _PLAYER_DIRECTION=3
' **************
' animate player
' **************
' ***********
' normal mode
' ***********
If _PLAYER_STATE=0 and _PLAYER_FRAME_DELAY=0
Add _PLAYER_FRAME,1,1 To 4
End If
' ***********
' absorb mode
' ***********
If _PLAYER_STATE=1 and _PLAYER_FRAME_DELAY=0
Add _PLAYER_FRAME,1,22 To 25
End If
' ***********
' move player
' ***********
Add _PLAYER_X,_PLAYER_SPEED
' *************
' test for wall
' *************
If MAP(Int(_PLAYER_X+15)/16,Int(_PLAYER_Y/16))>=WALL_START or MAP(Int(_PLAYER_X+15)/16,Int((_PLAYER_Y+15)/16))>=WALL_START
Add _PLAYER_X,-_PLAYER_SPEED
End If
End If
' ****
' left
' ****
If _PLAYER_DIRECTION=6 or _PLAYER_DIRECTION=5 or _PLAYER_DIRECTION=7
' **************
' animate player
' **************
' ***********
' normal mode
' ***********
If _PLAYER_STATE=0 and _PLAYER_FRAME_DELAY=0
Add _PLAYER_FRAME,1,5 To 8
End If
' ***********
' absorb mode
' ***********
If _PLAYER_STATE=1 and _PLAYER_FRAME_DELAY=0
Add _PLAYER_FRAME,1,26 To 29
End If
' ***********
' move player
' ***********
Add _PLAYER_X,-_PLAYER_SPEED
' *************
' test for wall
' *************
If MAP(Int(_PLAYER_X)/16,Int(_PLAYER_Y/16))>=WALL_START or MAP(Int(_PLAYER_X/16),Int((_PLAYER_Y+15)/16))>=WALL_START
Add _PLAYER_X,_PLAYER_SPEED
End If
End If
Add _PLAYER_FRAME_DELAY,1,0 To 1
' ************************************
' has player collided with a monster ?
' ************************************
If Bob Col(19,15 To 18)
' *****************************************
' yes we have collided
' so if we are holding a bomb get rid of it
' *****************************************
If _PLAYER_STATE=1
' **********************************
' find out which bomb we are holding
' **********************************
For COUNT=0 To 4
' ******************************
' this is the one we are holding
' ******************************
If BOMB_STATE(COUNT)=3
' ********************
' make it non-existant
' ********************
BOMB_STATE(COUNT)=0
End If
Next COUNT
' ******************************
' reduce number of bombs in maze
' ******************************
Dec BOMBS_ON
End If
' ************************
' set player mode to dying
' ************************
_PLAYER_STATE=2
' *********************
' and get correct frame
' *********************
_PLAYER_FRAME=43
' *******************************
' aaaarrrrrrgggggghhhhhh!!!!!!!!!
' *******************************
If SOUND=1
Sam Raw 3,Start(10)+8212,5940,10000
End If
End If
' *************************************
' has player dropped bomb down portal ?
' *************************************
If MAP(Int((_PLAYER_X+7)/16),Int((_PLAYER_Y+7)/16))=1 and _PLAYER_STATE=1
If _PLAYER_STATE=1 and(MAP(Int((_PLAYER_X+7)/16),Int((_PLAYER_Y+7)/16))>=FLOOR_START or MAP(Int((_PLAYER_X+7)/16),Int((_PLAYER_Y+7)/16))=0) and MAP(Int((_PLAYER_X+7)/16),Int((_PLAYER_Y+7)/16))<WALL_START and Not Fire(1)
If DROP_DELAY<=0 and BOMBS_ON<5 and((MAP(Int(BADDY_X(COUNT)/16),Int(BADDY_Y(COUNT)/16))=0 or MAP(Int(BADDY_X(COUNT)/16),Int(BADDY_Y(COUNT)/16))>=FLOOR_START) and MAP(Int(BADDY_X(COUNT)/16),Int(BADDY_Y(COUNT)/16))<WALL_START)